import {
  createRouter,
  createWebHistory,
  createWebHashHistory,
} from 'vue-router';
/**
 * 公开路由表
 */

const publicRoutes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue'),
  },
  {
    path: '/',
    redirect: '/login',
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/home/Home.vue'),
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import('@/views/map/homeMap.vue'),
      },
      {
        path: '/home_map',
        name: 'home_map',
        component: () => import('@/views/map/homeMap.vue'),
      },
      {
        path: '/cockpit',
        name: 'cockpit',
        component: () => import('@/views/cockpit/Cockpit.vue'),
      },
      {
        path: '/scene',
        name: 'scene',
        component: () => import('@/views/scene/Scene.vue'),
      },
      {
        path: '/reportMedicalFront',
        name: 'reportMedicalFront',
        component: () =>
          import('@/views/reportMedicalFront/ReportMedicalFront.vue'),
        redirect: {
          name: 'reportmedicalfk',
        },
        children: [
          {
            path: '/reportmedicalfk',
            name: 'reportmedicalfk',
            component: () => import('@/views/reportMedical/index.vue'),
            children: [
              {
                path: 'injureReport',
                name: 'injureReport',
                component: () => import('@/views/injureReport/index.vue'),
              },
              {
                path: 'MedicalSecurityReport',
                name: 'MedicalSecurityReport',
                component: () =>
                  import('@/views/reports/MedicalSecurityReport/index.vue'),
              },
              {
                path: 'asiaAthleteReport',
                name: 'asiaAthleteReport',
                component: () =>
                  import('@/views/reports/asiaAthleteReport/index.vue'),
              },
              {
                path: 'asiaAthleteInfectiousReport',
                name: 'asiaAthleteInfectiousReport',
                component: () =>
                  import(
                    '@/views/reports/asiaAthleteInfectiousReport/index.vue'
                  ),
              },
              {
                path: '/sybrxxbReport',
                name: 'sybrxxbReport',
                component: () =>
                  import('@/views/reports/sybrxxbReport/index.vue'),
              },
              {
                path: '/PatientLevelLSReport',
                name: 'PatientLevelLSReport',
                component: () =>
                  import('@/views/reports/PatientLevelReport/indexLS.vue'),
              },
              {
                path: '/PatientLevelTJReport',
                name: 'PatientLevelTJReport',
                component: () =>
                  import('@/views/reports/PatientLevelReport/indexTJ.vue'),
              },
              {
                path: '/medicalTotalReport',
                name: 'medicalTotalReport',
                component: () =>
                  import('@/views/reports/MedicalReport/index.vue'),
              },
              {
                path: '/patientRecordLSlReport',
                name: 'patientRecordLSlReport',
                component: () =>
                  import('@/views/reports/PatientRecordReport/index.vue'),
              },
            ],
          },
          {
            path: '/medicalpreportfk',
            name: 'medicalpreportfk',
            component: () => import('@/views/medicalPReport/layout.vue'),
            children: [
              {
                path: 'medicalPReport',
                name: 'medicalPReport',
                component: () => import('@/views/medicalPReport/index.vue'),
              },
              {
                path: 'sybrxxbReport',
                name: 'sybrxxbReport',
                component: () =>
                  import('@/views/reports/sybrxxbReport/index.vue'),
              },
            ],
          },
        ],
      },
    ],
  },
  {
    path: '/background_manage',
    name: 'background_manage',
    component: () => import('@/layout/index.vue'),
    redirect: '/users',
    children: [
      {
        path: '/users',
        name: 'users',
        component: () => import('@/views/users/index.vue'),
        children: [],
      },
      {
        path: '/shikuang',
        name: 'shikuang',
        component: () => import('@/views/scene/Scene.vue'),
      },
      {
        path: '/gym',
        name: 'gym',
        component: () => import('@/views/gym/index.vue'),
      },
      {
        path: '/plan',
        name: 'plan',
        component: () => import('@/views/plan/index.vue'),
      },
      {
        path: '/news',
        name: 'news',
        component: () => import('@/views/news/index.vue'),
      },
      {
        path: '/telbook',
        name: 'telbook',
        component: () => import('@/views/telbook/index.vue'),
      },
      {
        path: '/hospital',
        name: 'hospital',
        component: () => import('@/views/hospital/index.vue'),
      },
      {
        path: '/drugs',
        name: 'drugs',
        component: () => import('@/views/drugs/index.vue'),
      },
      {
        path: '/activity',
        name: 'activity',
        component: () => import('@/views/activity/index.vue'),
      },
      {
        path: '/venues',
        name: 'venues',
        component: () => import('@/views/venues/index.vue'),
      },
      {
        path: '/ambulance',
        name: 'ambulance',
        component: () => import('@/views/ambulance/index.vue'),
      },
      {
        path: '/medicalPerson',
        name: 'medicalPerson',
        component: () => import('@/views/medicalPerson/index.vue'),
      },
      {
        path: '/rights',
        name: 'rights',
        component: () => import('@/views/rights/index.vue'),
      },
      {
        path: '/roles',
        name: 'roles',
        component: () => import('@/views/roles/index.vue'),
      },
      {
        path: '/medicalPoint',
        name: 'medicalPoint',
        component: () => import('@/views/medicalPoint/index.vue'),
      },
      {
        path: '/userApplyPage',
        name: 'userApplyPage',
        component: () => import('@/views/userApplyPage/index.vue'),
      },
      {
        path: '/schedulePage',
        name: 'schedulePage',
        component: () => import('@/views/schedulePage/index.vue'),
      },
      {
        path: '/patientModifyLog',
        name: 'patientModifyLog',
        component: () => import('@/views/modifyrecord/index.vue'),
      },
      {
        path: '/dictionary',
        name: 'dictionary',
        component: () => import('@/views/dictionary/index.vue'),
      },
      {
        path: '/dictionaryBlock',
        name: 'dictionaryBlock',
        component: () => import('@/views/dictionary/dicBlock.vue'),
      },
      {
        path: '/surplus',
        name: 'surplus',
        component: () => import('@/views/suplus/index.vue'),
      },
      {
        path: '/reportMedical',
        name: 'reportMedical',
        component: () => import('@/views/reportMedical/index.vue'),
        children: [
          {
            path: 'injureReport',
            name: 'injureReport',
            component: () => import('@/views/injureReport/index.vue'),
          },
          {
            path: 'MedicalSecurityReport',
            name: 'MedicalSecurityReport',
            component: () =>
              import('@/views/reports/MedicalSecurityReport/index.vue'),
          },
          {
            path: 'asiaAthleteReport',
            name: 'asiaAthleteReport',
            component: () =>
              import('@/views/reports/asiaAthleteReport/index.vue'),
          },
          {
            path: 'asiaAthleteInfectiousReport',
            name: 'asiaAthleteInfectiousReport',
            component: () =>
              import('@/views/reports/asiaAthleteInfectiousReport/index.vue'),
          },
        ],
      },
      {
        path: '/reportHospital',
        name: 'reportHospital',
        component: () => import('@/views/medicalPReport/layout.vue'),
        children: [
          {
            path: 'medicalPReport',
            name: 'medicalPReport',
            component: () => import('@/views/medicalPReport/index.vue'),
          },
          {
            path: 'sybrxxbReport',
            name: 'sybrxxbReport',
            component: () => import('@/views/reports/sybrxxbReport/index.vue'),
          },
        ],
      },
      // {
      //   path: '/reportDesign',
      //   name: 'reportDesign',
      //   component: () => import('@/views/reportDesign/index.vue'),
      // },
      {
        path: '/error',
        component: () => import('@/views/result/error.vue'),
      },
      // 地图管理
      {
        path: '/mapManage',
        name: 'mapManage',
        component: () => import('@/views/mapManage/MapManage.vue'),
      },
      // 线路列表
      {
        path: '/poylineList',
        name: 'poylineList',
        component: () => import('@/views/poylineList/PoylineList.vue'),
      },
    ],
  },
  {
    path: '/users/patient/:id/:type',
    name: 'patient',
    component: () => import('@/views/users/patient.vue'),
  },
  {
    path: '/medicalPReport',
    name: 'medicalPReport',
    component: () => import('@/views/medicalPReport/index.vue'),
  },
  {
    path: '/injureReport',
    name: 'injureReport',
    component: () => import('@/views/injureReport/index.vue'),
  },
  {
    path: '/MedicalSecurityReport',
    name: 'MedicalSecurityReport',
    component: () => import('@/views/reports/MedicalSecurityReport/index.vue'),
  },
  {
    path: '/asiaAthleteReport',
    name: 'asiaAthleteReport',
    component: () => import('@/views/reports/asiaAthleteReport/index.vue'),
  },
  {
    path: '/asiaAthleteInfectiousReport',
    name: 'asiaAthleteInfectiousReport',
    component: () =>
      import('@/views/reports/asiaAthleteInfectiousReport/index.vue'),
  },
  {
    path: '/sybrxxbReport',
    name: 'sybrxxbReport',
    component: () => import('@/views/reports/sybrxxbReport/index.vue'),
  },
  {
    path: '/PatientLevelLSReport',
    name: 'PatientLevelLSReport',
    component: () => import('@/views/reports/PatientLevelReport/indexLS.vue'),
  },
  {
    path: '/PatientLevelTJReport',
    name: 'PatientLevelTJReport',
    component: () => import('@/views/reports/PatientLevelReport/indexTJ.vue'),
  },
  {
    path: '/medicalTotalReport',
    name: 'medicalTotalReport',
    component: () => import('@/views/reports/MedicalReport/index.vue'),
  },
  {
    path: '/patientRecordLSlReport',
    name: 'patientRecordLSlReport',
    component: () => import('@/views/reports/PatientRecordReport/index.vue'),
  },
];

const router = createRouter({
  // history: createWebHashHistory(process.env.BASE_URL),
  history: createWebHashHistory(),

  routes: publicRoutes,
});

export default router;
